#pragma once
#include <d3d11.h>
#include <DirectXMath.h>
#include "ShaderGroup.h"
#include "Texture.h"
using namespace DirectX;


class D3DPlane 
{
public:
	D3DPlane();
	~D3DPlane();

	HRESULT CreatePlane(ID3D11Device* device, float width, float height, const char* texturePath, XMFLOAT4X4 wMatrix);

	void Render(ID3D11DeviceContext* pContext, ShaderGroup* shader, VS_CONSTANT_BUFFER* vsConstBufferInfo, DIR_LIGHT_BUFFER* dlbufferInfo, POINT_LIGHT_BUFFER* plbufferInfo, SPOT_LIGHT_BUFFER* slbufferInfo, float dt);
	void SetWorldMatrix(XMFLOAT4X4 newMatrix);
	void ShutDown();

	struct VERTEX
	{
		XMFLOAT3 pos;
		XMFLOAT3 normal;
		XMFLOAT2 uv;
		XMFLOAT4 _color;

	};

private:
	HRESULT LoadTexture(ID3D11Device* device, const char* path);
	XMFLOAT4X4 matrix;
	ID3D11Buffer *m_pVertexBuffer, *m_pIndexBuffer;
	Texture m_pTexture;

	void DrawPlane();
	unsigned int m_nNumVerts, m_nNumIndicies;
	
};

